package com.foreknow.service.impl;

import com.foreknow.dao.RuleMapper;
import com.foreknow.entity.Rule;
import com.foreknow.service.RuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RuleServiceImpl implements RuleService {
    @Autowired
    RuleMapper ruleMapper;
    @Override
    public List<Rule> queryUserWeek() {
        return ruleMapper.selectUserWeek();
    }

    @Override
    public Rule queryByid(int id) {
        return ruleMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Rule> queryRuleByQuery(Integer deptId, Integer registleveId) {
        return null;
    }

    @Override
    public boolean addRules(List<Rule> rules) {
        return ruleMapper.insertRules(rules)>0;
    }
}
